from django.conf.urls import url
from rest_framework.routers import DefaultRouter

from . import views

urlpatterns = [
    # 查询所有省
    # url(r'^areas/$', views.ArealListView.as_view()),
    # url(r'^areas/(?P<pk>\d+)/$', views.AreaDetailView.as_view()),
    # url(r'^areas/$', views.AreaModelViewSet.as_view({'get': 'list'})),
    # url(r'^areas/(?P<pk>\d+)/$', views.AreaModelViewSet.as_view({'get': 'retrieve'})),
]

router = DefaultRouter()
router.register(r'areas', views.AreaModelViewSet, base_name='area')  # 路由别名前缀 如果视图集中就必须指定base_name参数

urlpatterns += router.urls
